package mviewer.renderer.software.shader;

import java.awt.Color;
import mviewer.renderer.software.interfaces.ILighting;
import java.awt.Graphics;
import java.awt.Polygon;
import mviewer.renderer.software.interfaces.IBuffer;
import mviewer.renderer.software.interfaces.IShader;
import mviewer.types.IPolygon;

public class FlatShader implements IShader {

	@Override
	public void drawPolygon(Graphics g, IPolygon p3, Polygon p2,
			ILighting l, IBuffer buffer) {
		Color color = l.renderColor(p3.getVertices()[0], p3.getNormal(), p3.getMaterial());

		g.setColor(color);
		g.fillPolygon(p2);
	}
}